  function fnSubmitDefects()
  {
	  alert('erer');
	  var defectDump = document.getElementById("defectDump").value;
	  var projectCode = document.getElementById('cboProjectCode').options[document.getElementById('cboProjectCode').selectedIndex].text;
	  var month = document.getElementById('cboMonth').options[document.getElementById('cboMonth').selectedIndex].text;
	  var year = document.getElementById('cboYear').options[document.getElementById('cboYear').selectedIndex].text;
	  return window.confirm("Are you sure want to submit \n"+defectDump+"\nas defect dump of project "+projectCode+" for "+month+"-"+year+"?");
  }
  
  
  function fnExtensionCheck() 
  {
	  extArray = new Array(".xls", ".xlsx");
	  var file = document.getElementById("defectDump").value;
	  allowSubmit = false;
	  if (!file) return;
	  while (file.indexOf("\\") != -1)
	  file = file.slice(file.indexOf("\\") + 1);
	  ext = file.slice(file.indexOf(".")).toLowerCase();
	  for (var i = 0; i < extArray.length; i++) {
	  if (extArray[i] == ext) { allowSubmit = true; break; }
	  }
	  if (allowSubmit) return fnSubmitDefects();
	  else
	  alert("Please upload only valid excel files with extensions :  "
	  + (extArray.join("  ")) + "\nPlease select a new "
	  + "defect dump file to upload and submit again.");
	  return false;
  }
  
  function changeNavHover(whereTo)
  {
  	// Reset navOn class on the nav bar
  	for(i=0; i < document.getElementById("menu").getElementsByTagName("li").length; i++)
  	{
  		document.getElementById("menu").getElementsByTagName("li")[i].className = "";
  	}
  	// Find what page we are going to and update navigation
  	uri = parseUri(whereTo);
  	if(document.getElementById("page-"+uri.queryKey.page))
  	{
  		document.getElementById("page-"+uri.queryKey.page).className = "navOn";
  	}
  }
  
  function updateCrumbs()
  {
	  var newPageURL = document.URL;
	 // if (!newPageURL) return;
	 // while (newPageURL.indexOf("\\") != -1)
		 // newPageURL = newPageURL.slice(newPageURL.indexOf("\\") + 1);
/* 	  while (newPageURL.indexOf("/") != -1)
		  newPageURL = newPageURL.slice(newPageURL.indexOf("/") + 1); */
	  
	 // alert(newPageURL);
   newPageURL = newPageURL.replace('defectupload.dp','viewDefectUpload.dp'); 	  
   var navLinks = document.getElementById('menu').getElementsByTagName("a");
   for(var i=0;i<navLinks.length;i++)
   {
	//alert("checking and doing it for "+navLinks[i].href);
	//alert("ad"+navLinks[i].href);
    navLinks[i].className = navLinks[i].href==newPageURL ? "current" : "";
   }
  }